<template>
    <div v-if="anno">
        <MyTitle title="公告详情"></MyTitle>
        <el-row>
            <el-col :span="9">
                <el-card :body-style="{ padding: '0px' }">
                    <img :src="anno.desc.replace(/public/, baseURL)" class="image" />
                    <div style="padding: 14px">
                        <span>标题 ： {{ anno.title }}</span>
                        <div class="bottom">
                            <div v-html="anno.content"></div>
                            <p>
                                <time class="time">{{ $filters.timeFormat(anno.time, 'YYYY-MM-DD mm:ss') }}</time>
                            </p>
                            <el-button text class="button">评论</el-button>
                        </div>
                    </div>
                </el-card>
            </el-col>
        </el-row>
    </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { Http } from "../../api/api";
import { baseURL } from "../../api/request";

const anno = ref<any>(null)
const route = useRoute()
const getAnnoDetail = async () => {
    let res = await Http.getannodetail({
        _id: route.params.aid
    }) as any;
    if (res.code == 200) {
        anno.value = res.result
    }
}
onMounted(() => {
    getAnnoDetail()
})
</script>

<style lang="scss" scoped>
.image {
    width: 100%;
}
</style>